<?php

class Zend_View_Helper_EncodeName{
	
	public function encodeName($name,$mode=1){
  		
		if($mode==1){
		
			return preg_replace('/[^0-9a-zA-Z]+/','_',$name);
			
		}else if($mode==0){
			
			return str_replace(' ','_',$name);
			
		}
		
		return '';
		
	}

}

